]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
data: ensure systemd environment is sanitized when shell exits
authorRay Strode <rstrode@redhat.com>
Wed, 25 Mar 2020 20:30:46 +0000 (16:30 -0400)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 25 Mar 2020 21:34:47 +0000 (21:34 +0000)
When mutter is acting as a display server it sets a number of
environment variables in the user's session. These variables
tell applications where the display server's sockets are.

When the shell exits at logout time it leaves these environment
variables in the systemd --user environment, which can confuse
subsequent sessions.

This commit clears up the environment on exit.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1129

data/gnome-shell-wayland.service.in

index 04f94af2d64e375cdd7d2def78885d6ff60a2313..100be7f0f1854c29a59a5329b0621eb77cdc92c6 100644 (file)
@@ -19,6 +19,10 @@ Before=gnome-session-initialized.target
 [Service]
 Type=notify
 ExecStart=@bindir@/gnome-shell
+
+# unset some environment variables that were set by the shell and won't work now that the shell is gone
+ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY
+
 # Exit code 1 means we are probably *not* dealing with an extension failure
 SuccessExitStatus=1
 # On wayland we cannot restart